import { request } from '@/service/request';
import type { DeptSearchParams, DeptVO, System } from '@/service/types/system';

// 查询部门列表
export const listDept = (query: DeptSearchParams) => {
  return request<System.DeptVo>({
    url: '/system/dept/depts',
    method: 'get',
    params: query
  });
};
// 获取部门详情
export const getDept = (id: number) => {
  return request<DeptVO>({
    url: `/system/dept/${id}`,
    method: 'get'
  });
};
// 新增部门
export const addDept = (data: DeptVO) => {
  return request({
    url: `/system/dept`,
    method: 'POST',
    data
  });
};
// 修改部门
export const editDept = (data: DeptVO) => {
  return request({
    url: `/system/dept`,
    method: 'PUT',
    data
  });
};

// 修改部门
export const delDept = (id: number | number[]) => {
  return request({
    url: `/system/dept/${id}`,
    method: 'DELETE'
  });
};

export const leaderOption = () => {};
